<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>07on注册事件的两种方式</title>
</head>
<body>
    <input type="button" value="增加" id="btn">
    <div>
        <p>111111</p>
        <p>111111</p>
        <p>111111</p>
        <p>111111</p>
    </div>

    <script src="../jquery-3.2.1.js"></script>
    <script>
        $(function(){
            $("div").on("click","p", function(){
                alert("a");
            });

            $("#btn").on("click",function(){
                $("<p>我是新建的p元素</p>").appendTo("div");
            })
        })

    
    </script>
</body>
</html>